package com.corpgovernment.permission.controller;

import com.corpgovernment.common.base.BaseUserInfo;
import com.corpgovernment.common.base.JSONResult;
import com.corpgovernment.common.base.ResourceInfo;
import com.corpgovernment.permission.service.RoleResourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：xks
 * @date ：Created in 2022/7/19 18:35
 * @description：
 * @modified By：
 * @version: $
 */
@Slf4j
@RestController
@RequestMapping("/resource")
public class RoleResourceRest {

    @Autowired
    private RoleResourceService roleResourceService;

    @PostMapping("/findUserResourceData")
    public JSONResult<ResourceInfo> findUserResourceData (@RequestBody BaseUserInfo baseUserInfo) {
        return JSONResult.success(roleResourceService.getResourceData(baseUserInfo.getRoleId()));
    }

}
